package com.framework.loippi.controller.api;

import com.framework.loippi.api.utils.ApiUtils;
import com.framework.loippi.controller.api.ApiBaseController;
import com.framework.loippi.service.TUserSettingService;
import com.framework.loippi.support.Setting;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName SettingController
 * @Description TODO
 * @Author fsociety
 * @Date 8/1/2020 下午5:48
 * @Version 1.0
 */
@Controller("apiSettingController")
@RequestMapping("/api/system")
@Api(tags = {"系统信息"})
public class SettingController extends ApiBaseController {

    @Autowired
    private TUserSettingService tUserSettingService;

    @RequestMapping(value = "/findServicePhone.json", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @ApiOperation("获取客服电话")
    public @ResponseBody
    String getCSPhone() {
        String phone = tUserSettingService.findServicePhone();
        Map<String,Object> map = new HashMap<>();
        map.put("phone", phone);

        return ApiUtils.success(map);
    }
}
